package com.lovo.invoicing.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lovo.invoicing.bean.BuyInfoBean;
import com.lovo.invoicing.bean.PageBean;
import com.lovo.invoicing.bean.vo.BuyInfoBuyBean;
import com.lovo.invoicing.service.IBuyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/buyInfo")
public class BuyInfoController {
    @Autowired
    IBuyInfoService buyInfoService;
    @RequestMapping("/findBuyInfoByPage")
    public IPage<BuyInfoBean> findBuyInfoByPage(@RequestBody PageBean<BuyInfoBean> pageBean){
        return buyInfoService.queryBuyInfoByPage(pageBean);
    }
    //查看采购详情
    @RequestMapping("/findByBuyInfoId")
    List<BuyInfoBuyBean> findByBuyInfoId(int buyInfoId){
        return buyInfoService.queryByBuyInfoId(buyInfoId);
    }
}
